home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 008a / bootm.zip / BOOTM.DOC next >
Text File  |  1991-10-14  |  9KB  |  197 lines

  1. BOOTM.DOC -  10/14/91       by Dave Angel
  2.     Compuserve 75300,1166
  3.     usenet     75300.1166@COMPUSERVE.COM
  4.  
  5. References in this document to locations to other files give locations in terms
  6. of Compuserve forum name and library.  These files may be available elsewhere,
  7. but I can't help there.
  8.  
  9. This boot system is a simple approach to having multiple Config.sys and
  10. Autoexec.bat needs.  There are several sophisticated approaches, but this one
  11. is designed to be simple and versatile.
  12.  
  13. The simplest multi-boot method is to have pairs of config.sys and autoexec.bat
  14. files.  You have a batch file to copy one pair to the root directory, and
  15. that's all.  The problem with it is that these files have to be separately
  16. maintained, and yet they're quite similar.
  17.  
  18. The most complete multi-boot system I've seen is BOOT14.ZIP in IBMSYS LIB1 by
  19. Hans Salvisberg.  This shareware allows you to select which boot setup you want
  20. at boot time, which is a boon to those changing frequently.  The problems are
  21. that setting up the config.sys file is tricky and time consuming, and that your
  22. system is then dependent on this driver.
  23.  
  24. What I wanted (for my own use only) was a system which could be easily
  25. maintained with a plain-vanilla boot disk, using only a text editor in a pinch,
  26. that didn't require me to duplicate more than a minimal part of my bootup setup
  27. between multiple configurations.  So I compromised, and came up with this
  28. system.  It has many limitations, but it's simple, free, and suits me fine.  If
  29. anyone else likes it, all I request is a electronic message saying so.  And if
  30. you're not on Compuserve or Usenet, go ahead and use it anyway.
  31.  
  32. Most of the boot-time complexity of my system is in the autoexec.bat file, not
  33. in the config.sys file.  And batch files already have branching capability.  So
  34. if the config.sys file could send parameters to the autoexec.bat, only the
  35. former would have to be switched between configurations.
  36.  
  37. The principle is that you keep a set of two or more config.sys files in a
  38. subdirectory on your hard disk.  Each *.sys contains enough information to
  39. determine both the .sys and the auto*.bat behavior at boot time.  Therefore all
  40. that's needed to switch boots is to copy one of these files on top of
  41. Config.sys.  That can be done with a 1-line batch file, or with a command
  42. issued from a plain-vanilla floppy boot.
  43.  
  44. Included with this BOOTM.LZH is one program, called MAKEAUTO.EXE (with Turbo
  45. Pascal source).  This program can make a batch file out of selected remark
  46. lines in Config.sys.  All the rest of the package is contained in this DOC
  47. file, from which you can cut and paste sample batch files, or just use the
  48. ideas to design your own.
  49.  
  50. ------------------------------------------------------------------------------
  51. This package assumes you have at least MSDOS or PCDOS version 4, or whatever
  52. the equivalent in DRDOS is.  If you have an earlier DOS version, you'll get one
  53. or more config.sys errors, as there was no REM command in earlier versions.
  54. These errors are annoying, but harmless.
  55.  
  56. If your DOS is earlier than 3.3, you'll also have trouble with the CALL
  57. statement.  However, that's not necessary, and in fact I don't use CALL in my
  58. own configurations.
  59.  
  60. If your DOS is earlier than 3.0, you'll have trouble throughout with the
  61. examples, as they assume you can directly run a program or batch file in an
  62. arbitrary directory.
  63. ------------------------------------------------------------------------------
  64. Since there's no install program, I have to explain what the pieces are, and
  65. how you might typically create them.
  66.  
  67. MAKEAUTO.EXE goes somewhere in your C: drive, perhaps in C:\STARTUP.  Since you
  68. typically use it long before you've set up a PATH, my examples are hard coded
  69. to C:\STARTUP.  It doesn't need to be in the PATH, since it's not much use
  70. later in the session.
  71.  
  72. A directory is needed, which might be called C:\AUTOBAK.  This directory will
  73. contain multiple files of the form  xxxxxxxx.SYS,  where each configuration has
  74. an 8 character name.  It's also a good place to stash extra copies of
  75. AUTOEXEC.BAT and AUTO2.BAT, just in case some nasty install program decides to
  76. directly modify the ones in the root.
  77.  
  78. A single batch file is desirable, called perhaps NEWBOOT.BAT    Following is an
  79. example of what this might look like.
  80.  
  81. ++++NEWBOOT.BAT
  82. @echo off
  83. rem  Newboot %1       change to a new bootup configuration
  84. if not exist C:\autobak\%1.sys  goto error
  85. COPY c:\autobak\%1.sys c:\config.sys  >NULL
  86. echo  "%1" is new boot file.  You can reboot now.
  87. goto done
  88. :error
  89. echo  To run, type  NEWBOOT xxxx  (no extension) where the xxxx is taken from
  90. echo      the following list:
  91. DIR c:\autobak\*.sys | fgrep -x " sys "
  92. :done
  93. ++++
  94.  
  95. This particular example is far more complex than it needs to be.  Only the COPY
  96. command itself is really needed.  The example uses FGREP.ARC, which is
  97. available in IBMAPP LIB1.
  98.  
  99.  
  100. An autoexec.bat file is needed in the root, something like:
  101.  
  102. ++++AUTOEXEC.BAT
  103. @ECHO OFF
  104. PROMPT $p$g
  105. c:\bin\makeauto  c:\config.sys  c:\autobak\stuff$$$.bat
  106. autobak\stuff$$$
  107. ++++
  108.  
  109. This will make a new batch file, and branch there.
  110.  
  111. Finally, two or more  xxxxxxx.SYS files are needed in C:\AUTOBAK.  Below are
  112. possible examples of what these might look like:
  113.  
  114. ++++NORMAL.SYS
  115. REM   NORMAL   version of  CONFIG.SYS
  116. DOS=HIGH
  117. device=e:\asm\flush\flush.sys  Flushing the keyboard
  118. DEVICE=C:\QEMM\QEMM386.SYS RAM   EXCLUDE=A000-C7FF  Frame=E000
  119. FILES=40
  120. STACKS=0,0
  121. BUFFERS = 40
  122. LASTDRIVE=M
  123. DEVICE= C:\drivers\nansi.sys
  124. DEVICE=c:\qemm\loadhi.sys /r:3 C:\drivers\burndev.sys H+
  125. SHELL = C:\DOS\COMMAND.COM C:\DOS /P /E:500
  126. REM $rem The lines like these will be copied to the temporary STUFF$$$.BAT
  127. REM $rem    which will be chained from AUTOEXEC.BAT
  128. REM $c:\autobak\auto2   DOS5 EMS
  129. ++++
  130.  
  131. ++++STRIPPED.SYS
  132. REM   STRIPPED   version of  CONFIG.SYS
  133. FILES=40
  134. STACKS=0,0
  135. BUFFERS = 40
  136. LASTDRIVE=M
  137. SHELL = C:\DOS\COMMAND.COM C:\DOS /P /E:500
  138. REM $rem The lines like these will be copied to the temporary STUFF$$$.BAT
  139. REM $rem    which will be chained from AUTOEXEC.BAT
  140. REM $c:\autobak\auto2   DOS5 NOEMS
  141. ++++
  142.  
  143. These particular ones might be used to switch between a 386 configuration using
  144. QEMM to get expanded memory and load lots of TSRs high, and a plain vanilla
  145. configuration used for defragging.
  146.  
  147. The key feature here is the last line of each file, which invokes a batch file
  148. called AUTO2.BAT in the \autobak directory, passing it two arguments.
  149.  
  150. Parts of sample \autobak\AUTO2.BAT
  151.  
  152. ++++
  153. echo  My parms  are   %1  %2  %3  %4  %5  %6  %7  %8  %9
  154.  
  155. if not %1==WINDOWS  goto nowindows
  156. rem special stuff for Win3
  157. path f:\win3;c:\binc;c:\bincexe;c:\bat;c:\bin;c:\dos;c:\tp;c:\rexxterm;d:\pctools
  158. GOTO STEP3
  159.  
  160. :nowindows
  161. if not %2==EMS goto STEP2
  162. rem    EMS stuff
  163. path f:\win3;e:\c600\binb;e:\c600\bin;c:\binc;c:\bincexe;c:\bat;c:\bin;c:\dos;c:\tp;c:\rexxterm
  164. if not %1 == DOS5 lh C:\startup\SUPERPCK /S:1200      /-B   /T:4
  165. c:\qemm\loadhi c:\startup\rxintmgr
  166. c:\qemm\loadhi c:\STARTUP\ced.exe  -S4,750  -B1000,1000,3000,1000,128,128   LOAD c:\STARTUP\ced.cfg
  167. if     %2==EMS c:\qemm\loadhi c:\STARTUP\hs.com   /A30 /I2048 /X /b60000
  168. if not %2==EMS c:\STARTUP\hs.com   /A30 /I2048    /b10000
  169. c:\qemm\loadhi c:\startup\rxrun c:\bincexe  c:\bat  /N50
  170. c:\qemm\loadhi c:\dos\mirror c: d: e: f: /tc /td /te /tf
  171. goto   STEP3
  172. :STEP2
  173. etc.  ...................
  174. ++++
  175.  
  176. ------------------------------------------------------------------------------
  177. How it works:
  178.  
  179. You run NEWBOOT NORMAL  to copy C:\autobak\NORMAL.SYS into  C:\CONFIG.SYS.
  180. Then you reboot, once or several times.  At boot time, this config.sys file
  181. does its usual thing, but it ignores those lines beginning REM $.
  182.  
  183. Then AUTOEXEC.BAT gets control, and it runs MAKEAUTO.  MAKEAUTO.EXE extracts
  184. those REM $ lines from Config.sys and makes a new file STUFF$$$.BAT.  Then
  185. AUTOEXEC.BAT branches to this new file.
  186.  
  187. Depending on what's in these lines, there are lots of choices.  In one extreme,
  188. these lines (no limit to how many) could be the entire desired auto*.bat file.
  189. At the other extreme, they could branch to a unique batch file, so that every
  190. config file has a matching batch.  My examples have each of these branch to a
  191. common batch file, called AUTO2.BAT, but pass AUTO2.BAT varying parameters.
  192.  
  193. In AUTO2.BAT, these parameters are then used to customize what TSRs and other
  194. stuff get run, and how.  This way, the only thing that changes from one config
  195. to another is the particular config.sys file.
  196.  
  197.